package com.example.demo.proxy

import com.example.demo.model.*
import org.apache.poi.ss.usermodel.*
import xyz.erupt.annotation.`fun`.*
import xyz.erupt.annotation.query.Condition

@org.springframework.stereotype.Component // 可作为 “Spring Bean” 用于依赖注入
class ComponentDataProxy : DataProxy<Component> {

    override fun addBehavior(o: Component) {
        o.input = "ChinaCN"
        o.number1 = 3.1415926
        o.color = "#0099ff"
    }

    override fun beforeAdd(o: Component?) {
        System.err.println("beforeAdd")
    }

    override fun afterAdd(o: Component?) {
        System.err.println("afterAdd")
    }

    override fun beforeUpdate(o: Component?) {
        System.err.println("beforeUpdate")
    }

    override fun afterUpdate(o: Component?) {
        System.err.println("afterUpdate")
    }

    override fun beforeDelete(o: Component?) {
        System.err.println("beforeDelete")
    }

    override fun afterDelete(o: Component?) {
        System.err.println("afterDelete")
    }

    override fun beforeFetch(conditions: List<Condition>?): String? {
        System.err.println("beforeFetch")
        return null
    }

    override fun afterFetch(list: Collection<Map<String?, Any?>?>?) {
        System.err.println("afterFetch")
    }

    override fun editBehavior(o: Component?) {
        System.err.println("editBehavior")
    }

    override fun excelExport(wb: Workbook?) {
        System.err.println("excelExport")
    }

    override fun excelImport(o: Component?) {
        System.err.println("excelImport")
    }
}